package controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public abstract class Action {

    public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException {
        String acao = request.getParameter("acao");
        if (acao.equals("prepararOperacao")) {
            prepararOperacao(request, response);
        }
        if (acao.equals("confirmarOperacao")) {
            confirmarOperacao(request, response);
        }
    }

    public abstract void prepararOperacao(HttpServletRequest request, HttpServletResponse response) throws ServletException;

    public abstract void confirmarOperacao(HttpServletRequest request, HttpServletResponse response) throws ServletException;
}
